find_package(Eigen3 REQUIRED)
if(EIGEN3_FOUND)
    include_directories(${EIGEN3_INCLUDE_DIR})
endif()

find_package(GCTL REQUIRED)
if(GCTL_FOUND)
    include_directories(${GCTL_INCLUDE_DIR})
endif()

find_package(LibLCG REQUIRED)
if(LibLCG_FOUND)
    include_directories(${LibLCG_INCLUDE_DIR})
endif()

find_package(OpenMP REQUIRED)
if (OpenMP_CXX_FOUND)
    set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
    set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()

aux_source_directory(. SRC_DIR)
aux_source_directory(../utilities/ UTIL_SRC_DIR)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --std=c++11 -O3")
add_executable(mt2d_edge ${SRC_DIR} ${UTIL_SRC_DIR})
target_link_libraries(mt2d_edge PUBLIC ${GCTL_LIB})
target_link_libraries(mt2d_edge PUBLIC ${LibLCG_LIB})
target_link_libraries(mt2d_edge PUBLIC OpenMP::OpenMP_CXX)